package  
{
	import Box2D.Common.Math.b2Vec2;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2BodyDef;
	import Box2D.Dynamics.b2FixtureDef;
	import flash.geom.Rectangle;
	/**
	 * ...
	 * @author hbb
	 */
	public class BaseObject 
	{
		public var width:Number = 0;
		public var height:Number = 0;
		
		public var typeShape:String = 'box';
		public var b2_body:b2Body;
		public var b2_bodyDef:b2BodyDef = new b2BodyDef();
		public var b2_fixtureDef:b2FixtureDef = new b2FixtureDef();
		
		
		public function BaseObject() 
		{
		}
		
		public function hitTest( a_x:Number, a_y:Number ):Boolean
		{
			var pos:b2Vec2 = b2_body.GetPosition();
			var x:Number = pos.x * World.PIXELS_TO_METRE - width * .5;
			var y:Number = pos.y * World.PIXELS_TO_METRE - height * .5;
			var rect:Rectangle = new Rectangle( x - 2, y - 2, width + 4, height + 4 );
			return rect.contains( a_x, a_y );
		}
		
	}

}